home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / catD / LOCK.z / LOCK
Encoding:
Text File  |  1998-10-30  |  4.0 KB  |  133 lines

  1.  
  2.  
  3.  
  4. LLLLOOOOCCCCKKKK((((DDDD3333))))                                                              LLLLOOOOCCCCKKKK((((DDDD3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      LOCK - acquire a basic lock
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ttttyyyyppppeeeessss....hhhh>>>>
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////kkkkssssyyyynnnncccchhhh....hhhh>>>>
  14.      ####iiiinnnncccclllluuuuddddeeee <<<<ssssyyyyssss////ddddddddiiii....hhhh>>>>
  15.  
  16.      iiiinnnntttt LLLLOOOOCCCCKKKK((((lllloooocccckkkk____tttt ****_l_o_c_k_p,,,, ppppllll____tttt _p_l))));;;;
  17.  
  18.    AAAArrrrgggguuuummmmeeeennnnttttssss
  19.      _l_o_c_k_p     Pointer to the basic lock to be acquired.
  20.  
  21.      _p_l        The interrupt priority level to be set while the lock is held
  22.                by the caller.
  23.  
  24. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  25.      LOCK sets the interrupt priority level in accordance with the value
  26.      specified by _p_l and acquires the lock specified by _l_o_c_k_p.  If the lock is
  27.      not immediately available, the caller will busy-wait until the lock is
  28.      available.
  29.  
  30.    RRRReeeettttuuuurrrrnnnn VVVVaaaalllluuuueeeessss
  31.      Upon acquiring the lock, LOCK returns the previous mask for use by
  32.      UNLOCK.  Your driver should treat this return integer as an "opaque"
  33.      value and should not try to compare it with any other value or perform
  34.      any operation on it.
  35.  
  36. UUUUSSSSAAAAGGGGEEEE
  37.      Because some implementations require that interrupts that might attempt
  38.      to acquire the lock be blocked on the processor on which the lock is
  39.      held, portable drivers must specify a _p_l value that is sufficient to
  40.      block out any interrupt handler that might attempt to acquire this lock.
  41.      See the description of the _m_i_n__p_l argument to _LLLL_OOOO_CCCC_KKKK______AAAA_LLLL_LLLL_OOOO_CCCC(D3) for
  42.      additional discussion and a list of the valid values for _p_l.
  43.  
  44.    LLLLeeeevvvveeeellll
  45.      Base or Interrupt.
  46.  
  47.    SSSSyyyynnnncccchhhhrrrroooonnnniiiizzzzaaaattttiiiioooonnnn CCCCoooonnnnssssttttrrrraaaaiiiinnnnttttssss
  48.      Driver-defined sleep locks may be held across calls to this function.
  49.  
  50.      Driver-defined basic locks and read/write locks may be held across calls
  51.      to this function subject to the hierarchy -- but basic locks must be
  52.      unlocked in the reverse order in which they were acquired (first-in,
  53.      last-out).
  54.  
  55.    WWWWaaaarrrrnnnniiiinnnnggggssss
  56.      Basic locks are not recursive.  A call to LOCK attempting to acquire a
  57.      lock that is currently held by the calling context will result in
  58.      deadlock.
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. LLLLOOOOCCCCKKKK((((DDDD3333))))                                                              LLLLOOOOCCCCKKKK((((DDDD3333))))
  71.  
  72.  
  73.  
  74.      Calls to LOCK should honor the hierarchy ordering to avoid deadlock.
  75.  
  76.      When called from interrupt level, the _p_l argument must not specify a
  77.      priority level below the level at which the interrupt handler is running.
  78.  
  79. RRRREEEEFFFFEEEERRRREEEENNNNCCCCEEEESSSS
  80.      LOCK_ALLOC(D3), LOCK_DEALLOC(D3), LOCK_DESTROY(D3), LOCK_INIT(D3),
  81.      TRYLOCK(D3), UNLOCK(D3).
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.